<template>
  <div :class="`${themes[themeStatus]}`">
    <div style="margin: 10px 0">
      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入客户名称" suffix-icon="el-icon-search" v-model="client"></el-input>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入优先级" suffix-icon="el-icon-search" v-model="priority" ></el-input>-->
      <el-select v-model="priority" clearable placeholder="优先级" >
        <el-option v-for="item in optionsPriority" :key="item.valuePriority" :label="item.label" :value="item.value"></el-option>
      </el-select>
      <el-select v-model="type" clearable placeholder="类型" >
        <el-option v-for="item in optionsType" :key="item.valueType" :label="item.label" :value="item.value"></el-option>
      </el-select>
      <el-select v-model="bigModel" clearable placeholder="是否大模型" >
        <el-option v-for="item in optionsBigModel" :key="item.valueBigModel" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入类型" suffix-icon="el-icon-search" v-model="type" ></el-input>-->
      <el-select v-model="industry" clearable placeholder="行业" >
        <el-option v-for="item in optionsIndustry" :key="item.valueIndustry" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入行业" suffix-icon="el-icon-search" v-model="industry"></el-input>-->
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入区域" suffix-icon="el-icon-search" v-model="area"></el-input>-->
      <el-select v-model="area" clearable placeholder="区域" >
        <el-option v-for="item in optionsArea" :key="item.valueArea" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入责任BD" suffix-icon="el-icon-search" v-model="ownbd"></el-input>-->
      <el-select v-model="ownbd" clearable placeholder="责任BD" >
        <el-option v-for="item in optionsownbd" :key="item.valueownbd" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入合作状态" suffix-icon="el-icon-search" v-model="status"></el-input>-->
      <el-select v-model="status" clearable placeholder="合作状态" >
        <el-option v-for="item in optionsStatus" :key="item.valueStatus" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入拓展堵点" suffix-icon="el-icon-search" v-model="block"></el-input>-->
      <el-select v-model="block" clearable placeholder="拓展堵点" >
        <el-option v-for="item in optionsBlock" :key="item.valueBlock" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入签约类型" suffix-icon="el-icon-search" v-model="contractType"></el-input>-->
      <el-select v-model="contractType" clearable placeholder="签约类型" >
        <el-option v-for="item in optionsContractType" :key="item.valueContractType" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入责任FAE" suffix-icon="el-icon-search" v-model="ownfae"></el-input>-->
      <el-select v-model="ownfae" clearable placeholder="责任FAE" >
        <el-option v-for="item in optionsownfae" :key="item.valueownfae" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入当前状态" suffix-icon="el-icon-search" v-model="currentStatus"></el-input>-->
      <el-select v-model="currentStatus" clearable placeholder="当前状态" >
        <el-option v-for="item in optionsCurrentStatus" :key="item.valueCurrentStatus" :label="item.label" :value="item.value"></el-option>
      </el-select>
<!--      <el-select v-model="contractType" clearable placeholder="签约类型" >-->
<!--        <el-option v-for="item in optionsContractType" :key="item.valueContractType" :label="item.label" :value="item.value"></el-option>-->
<!--      </el-select>-->
<!--      <el-input style="width: 200px;margin-left: 10px" placeholder="请输入硬件类型" suffix-icon="el-icon-search" v-model="hardType"></el-input>-->
      <el-select v-model="hardType" clearable placeholder="硬件类型" >
        <el-option v-for="item in optionsHardType" :key="item.valueHardType" :label="item.label" :value="item.value"></el-option>
      </el-select>
      <span style="margin-left: 10px">拜访日期</span>
      <el-date-picker v-model="startDate" value-format="yyyy-MM-dd" placeholder="选择日期" style="margin-left: 5px"></el-date-picker>
      <span style="margin-left: 5px">至</span>
      <el-date-picker v-model="endDate" value-format="yyyy-MM-dd" placeholder="选择日期" style="margin-left: 5px"></el-date-picker>
      <!--      <el-input style="width: 200px" placeholder="请输入" suffix-icon="el-icon-message" class="ml-5" v-model="email"></el-input>-->
      <!--      <el-input style="width: 200px" placeholder="请输入" suffix-icon="el-icon-position" class="ml-5" v-model="address"></el-input>-->
      <el-button class="ml-5" type="primary" plain @click="load">搜索</el-button>
      <el-button type="info" plain @click="reset">重置</el-button>
    </div>

    <div style="margin: 10px 0">
      <el-button type="primary" plain @click="handleAdd">新增 <i class="el-icon-circle-plus-outline"></i></el-button>
      <el-popconfirm
        class="ml-5"
        confirm-button-text="确定"
        cancel-button-text="我再想想"
        icon="el-icon-info"
        icon-color="red"
        title="您确定批量删除这些数据吗？"
        @confirm="delBatch"
      >
<!--        v-if=""-->
        <el-button   v-if="this.user.role ==='ROLE_ADMIN'" type="danger" plain slot="reference">批量删除 <i class="el-icon-remove-outline"></i></el-button>
      </el-popconfirm>
      <!-- <el-upload action="http://localhost:9090/xCompany/import" :show-file-list="false" accept="xlsx" :on-success="handleExcelImportSuccess" style="display: inline-block">
        <el-button type="primary" class="ml-5">导入 <i class="el-icon-bottom"></i></el-button>
      </el-upload>
      <el-button type="primary" @click="exp" class="ml-5">导出 <i class="el-icon-top"></i></el-button> -->
    </div>

    <el-table height="1300px" :data="tableData" stripe @selection-change="handleSelectionChange" :header-cell-style="{ 'padding-left': '4px', 'padding-right': '4px' }">
      <el-table-column type="selection" width="55"></el-table-column>
<!--      <el-table-column prop="id" label="ID" width="80" sortable></el-table-column>-->
      <el-table-column prop="client" label="客户" fixed="left">
        <template slot-scope="scope">
          <span class="row-client" @click="handleShowDetail(scope.row.id)">{{ scope.row.client }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="80" align="center">
        <template slot-scope="scope">
          <div class="table-row-options-warp">
            <span @click="handleEdit(scope.row)">编辑 </span>
            <el-popconfirm
                class="ml-5"
                confirm-button-text="确定"
                cancel-button-text="取消"
                icon="el-icon-info"
                icon-color="red"
                title="您确定删除这条数据吗？"
                @confirm="del(scope.row.id)"
            >
<!--              v-if="this.user.role ==='ROLE_ADMIN'" -->
              <span   v-if="user.role ==='ROLE_ADMIN'"  slot="reference">删除</span>
            </el-popconfirm>
          </div>
        </template>
      </el-table-column>
      <el-table-column prop="type" label="类型"></el-table-column>
      <el-table-column prop="industry" label="行业"></el-table-column>
      <el-table-column prop="area" label="区域"></el-table-column>
      <el-table-column prop="scene" label="业务场景"></el-table-column>
      <el-table-column prop="priority" label="优先级"></el-table-column>
      <el-table-column prop="space" label="算力空间"></el-table-column>
      <el-table-column prop="demand" label="需求"></el-table-column>
      <el-table-column prop="block" label="拓展堵点"></el-table-column>
      <el-table-column prop="solution" label="解决路径"></el-table-column>
      <el-table-column prop="status" label="合作状态"></el-table-column>
      <el-table-column prop="landingTime" label="落地时间"></el-table-column>
      <el-table-column prop="ownbd" label="责任BD"></el-table-column>
      <el-table-column prop="contractType" label="签约类型"></el-table-column>
      <el-table-column prop="contractCompute" label="签约算力"></el-table-column>
      <el-table-column prop="contractCycle" label="签约周期"></el-table-column>
      <el-table-column prop="contractScale" label="签约规模"></el-table-column>
<!--      <el-table-column prop="contractTime" label="签约时间"></el-table-column>-->
      <el-table-column prop="currentStatus" label="当前状态"></el-table-column>
      <el-table-column prop="onlineTime" label="上线时间"></el-table-column>
      <el-table-column prop="offlineTime" label="下线时间"></el-table-column>
<!--      <el-table-column prop="contractTime" label="签约时间"></el-table-column>-->
      <el-table-column prop="contractAmount" label="签约金额"></el-table-column>
      <el-table-column prop="remittanceAmount" label="回款状态"></el-table-column>
      <el-table-column prop="adaptationStatus" label="适配状态"></el-table-column>
      <el-table-column prop="adaptationType" label="适配类型"></el-table-column>
      <el-table-column prop="bigModel" label="是否大模型"></el-table-column>
      <el-table-column prop="modelName" label="大模型名称"></el-table-column>
      <el-table-column prop="adaptationProgress" label="适配进展"></el-table-column>
      <el-table-column prop="problemBlock" label="问题堵点"></el-table-column>
      <el-table-column prop="adaptationSolution" label="解决办法"></el-table-column>
      <el-table-column prop="ownfae" label="责任FAE"></el-table-column>
      <el-table-column prop="chancePoint" label="200DK机会点（台）"></el-table-column>
      <el-table-column prop="dksold" label="200DK已销售（台）"></el-table-column>
      <el-table-column prop="dkamount" label="200DK销售金额（元）"></el-table-column>
      <el-table-column prop="hardType" label="其他硬件带货硬件类型"></el-table-column>
      <el-table-column prop="hardChance" label="其他硬件带货机会点（台）"></el-table-column>
      <el-table-column prop="hardSold" label="其他硬件带货已销售（台）"></el-table-column>
      <el-table-column prop="hardAmount" label="其他硬件带货销售金额（台）"></el-table-column>


    </el-table>
    <div style="padding: 10px 0">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="pageNum"
        :page-sizes="[50, 100, 150, 200]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      >
      </el-pagination>
    </div>

    <el-dialog title="信息" :visible.sync="dialogFormVisible" width="40%" :close-on-click-modal="false">
      <el-form label-width="140px" size="small" style="width: 85%" :model="form" :rules="rules" ref="ruleForm">
        <el-form-item prop="client" label="客户">
          <el-input v-model="form.client" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="type" label="类型">
          <el-select v-model="form.type" placeholder="请选择">
            <el-option
                v-for="item in ['企业','高校','科研机构']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="bigModel" label="是否大模型">
          <el-select v-model="form.bigModel" placeholder="请选择">
            <el-option
                v-for="item in ['是','否']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="industry" label="行业">
          <el-select v-model="form.industry" placeholder="请选择">
            <el-option
                v-for="item in ['制造','数字政府','金融','运营商','安平','交通','互联网','医疗','教育','电力能源','大企业','农业']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="area" label="区域">
          <el-select v-model="form.area" placeholder="请选择">
            <el-option
                v-for="item in ['南京市','江北新区','无锡市','徐州市','常州市','苏州市','南通市','连云港市','淮安市','盐城市','扬州市','镇江市','泰州市','宿迁市','省外']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="scene" label="业务场景">
          <el-input v-model="form.scene" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="priority" label="优先级">
          <el-select v-model="form.priority" placeholder="请选择">
            <el-option
                v-for="item in ['高','中','低']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="space" label="算力空间">
          <el-input v-model="form.space" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="demand" label="需求">
          <el-input v-model="form.demand" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="block" label="拓展堵点">
          <el-select v-model="form.block" placeholder="请选择">
            <el-option
                v-for="item in ['客户数据安全原因','框架生态支持度低','910A芯片能力问题','算法算子不支持问题','没有联系方式','价格高，导致客户意愿度不高','适配工作量大或人力不足，导致客户意愿度不高','没有国产化诉求，导致客户意愿度不高']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="solution" label="解决路径">
          <el-input v-model="form.solution" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="status" label="合作状态">
          <el-select v-model="form.status" placeholder="请选择">
            <el-option
                v-for="item in ['没有联系方式','拓展中','技术适配中','适配完成','商务谈判中','完成采购协议','业务上线','合作停滞','业务下线','大模型合作']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="landingTime" label="落地时间">
          <el-date-picker v-model="form.landingTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="ownbd" label="责任BD">
          <el-select v-model="form.ownbd" placeholder="请选择">
            <el-option
                v-for="item in ['谢天','鲁曦','孙东明','李光峥','吴心一','唐旭','孙乾凯','董杰','曹中旭']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="contractType" label="签约类型">
          <el-input v-model="form.contractType" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractCompute" label="签约算力">
          <el-input v-model="form.contractCompute" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractCycle" label="签约周期">
          <el-input v-model="form.contractCycle" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractScale" label="签约规模">
          <el-input v-model="form.contractScale" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractTime" label="签约时间">
          <el-date-picker v-model="form.contractTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="currentStatus" label="当前状态">
          <el-select v-model="form.currentStatus" placeholder="请选择">
            <el-option
                v-for="item in ['已上线','蓄水','已结束']"
                :key="item"
                :label="item"
                :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="onlineTime" label="上线时间">
          <el-date-picker v-model="form.onlineTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="offlineTime" label="下线时间">
          <el-date-picker v-model="form.offlineTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="contractAmount" label="签约金额">
          <el-input v-model="form.contractAmount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="remittanceAmount" label="回款状态">
          <el-input v-model="form.remittanceAmount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationStatus" label="适配状态">
          <el-input v-model="form.adaptationStatus" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationType" label="适配类型">
          <el-input v-model="form.adaptationType" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="bigModel" label="是否大模型">
          <el-input v-model="form.bigModel" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="modelName" label="大模型名称">
          <el-input v-model="form.modelName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationProgress" label="适配进展">
          <el-input v-model="form.adaptationProgress" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="problemBlock" label="问题堵点">
          <el-input v-model="form.problemBlock" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationSolution" label="解决办法">
          <el-input v-model="form.adaptationSolution" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="ownfae" label="责任FAE">
          <el-select v-model="form.ownfae" placeholder="请选择">
          <el-option
              v-for="item in ['崔宝宝','赵慧慧','张亮','韩升原']"
              :key="item"
              :label="item"
              :value="item">
          </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="chancePoint" label="200DK机会点（台）">
          <el-input v-model="form.chancePoint" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="dksold" label="200DK已销售（台）">
          <el-input v-model="form.dksold" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="dkamount" label="200DK销售金额（元）">
          <el-input v-model="form.dkamount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardType" label="其他硬件带货硬件类型">
          <el-input v-model="form.hardType" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardChance" label="其他硬件带货机会点（台）">
          <el-input v-model="form.hardChance" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardSold" label="其他硬件带货已销售（台）">
          <el-input v-model="form.hardSold" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardAmount" label="其他硬件带货销售金额（台）">
          <el-input v-model="form.hardAmount" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="save">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog title="信息" :visible.sync="dialogFormVisible1" width="40%" :close-on-click-modal="false">
      <el-form label-width="140px" size="small" style="width: 85%" :model="form" :rules="rules" ref="ruleForm">
        <el-form-item prop="client" label="客户">
          <el-input v-model="form.client" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="type" label="类型">
          <el-select v-model="form.type" placeholder="请选择">
            <el-option
                    v-for="item in ['企业','高校','科研机构']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="bigModel" label="是否大模型">
          <el-select v-model="form.bigModel" placeholder="请选择">
            <el-option
                    v-for="item in ['是','否']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="industry" label="行业">
          <el-select v-model="form.industry" placeholder="请选择">
            <el-option
                    v-for="item in ['制造','数字政府','金融','运营商','安平','交通','互联网','医疗','教育','电力能源','大企业','农业']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="area" label="区域">
          <el-select v-model="form.area" placeholder="请选择">
            <el-option
                    v-for="item in ['南京市','江北新区','无锡市','徐州市','常州市','苏州市','南通市','连云港市','淮安市','盐城市','扬州市','镇江市','泰州市','宿迁市','省外']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="scene" label="业务场景">
          <el-input v-model="form.scene" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="priority" label="优先级">
          <el-select v-model="form.priority" placeholder="请选择">
            <el-option
                    v-for="item in ['高','中','低']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="space" label="算力空间">
          <el-input v-model="form.space" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="demand" label="需求">
          <el-input v-model="form.demand" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="block" label="拓展堵点">
          <el-select v-model="form.block" placeholder="请选择">
            <el-option
                    v-for="item in ['客户数据安全原因','框架生态支持度低','910A芯片能力问题','算法算子不支持问题','没有联系方式','价格高，导致客户意愿度不高','适配工作量大或人力不足，导致客户意愿度不高','没有国产化诉求，导致客户意愿度不高']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="solution" label="解决路径">
          <el-input v-model="form.solution" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="status" label="合作状态">
          <el-select v-model="form.status" placeholder="请选择">
            <el-option
                    v-for="item in ['没有联系方式','拓展中','技术适配中','适配完成','商务谈判中','完成采购协议','业务上线','合作停滞','业务下线','大模型合作']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="landingTime" label="落地时间">
          <el-date-picker v-model="form.landingTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="ownbd" label="责任BD">
          <el-select v-model="form.ownbd" placeholder="请选择">
            <el-option
                    v-for="item in ['谢天','鲁曦','孙东明','李光峥','吴心一','唐旭','孙乾凯','董杰','曹中旭']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="contractType" label="签约类型">
          <el-input v-model="form.contractType" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractCompute" label="签约算力">
          <el-input v-model="form.contractCompute" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractCycle" label="签约周期">
          <el-input v-model="form.contractCycle" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractScale" label="签约规模">
          <el-input v-model="form.contractScale" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="contractTime" label="签约时间">
          <el-date-picker v-model="form.contractTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="currentStatus" label="当前状态">
          <el-select v-model="form.currentStatus" placeholder="请选择">
            <el-option
                    v-for="item in ['已上线','蓄水','已结束']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="onlineTime" label="上线时间">
          <el-date-picker v-model="form.onlineTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="offlineTime" label="下线时间">
          <el-date-picker v-model="form.offlineTime" type="datetime" value-format="yyyy-MM-dd" placeholder="选择日期时间"></el-date-picker>
        </el-form-item>
        <el-form-item prop="contractAmount" label="签约金额">
          <el-input v-model="form.contractAmount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="remittanceAmount" label="回款状态">
          <el-input v-model="form.remittanceAmount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationStatus" label="适配状态">
          <el-input v-model="form.adaptationStatus" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationType" label="适配类型">
          <el-input v-model="form.adaptationType" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="bigModel" label="是否大模型">
          <el-input v-model="form.bigModel" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="modelName" label="大模型名称">
          <el-input v-model="form.modelName" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationProgress" label="适配进展">
          <el-input v-model="form.adaptationProgress" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="problemBlock" label="问题堵点">
          <el-input v-model="form.problemBlock" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="adaptationSolution" label="解决办法">
          <el-input v-model="form.adaptationSolution" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="ownfae" label="责任FAE">
          <el-select v-model="form.ownfae" placeholder="请选择">
            <el-option
                    v-for="item in ['崔宝宝','赵慧慧','张亮','韩升原']"
                    :key="item"
                    :label="item"
                    :value="item">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="chancePoint" label="200DK机会点（台）">
          <el-input v-model="form.chancePoint" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="dksold" label="200DK已销售（台）">
          <el-input v-model="form.dksold" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="dkamount" label="200DK销售金额（元）">
          <el-input v-model="form.dkamount" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardType" label="其他硬件带货硬件类型">
          <el-input v-model="form.hardType" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardChance" label="其他硬件带货机会点（台）">
          <el-input v-model="form.hardChance" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardSold" label="其他硬件带货已销售（台）">
          <el-input v-model="form.hardSold" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item prop="hardAmount" label="其他硬件带货销售金额（台）">
          <el-input v-model="form.hardAmount" autocomplete="off"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible1 = false">取 消</el-button>
        <el-button type="primary" @click="save1">确 定</el-button>
      </div>
    </el-dialog>

    <el-drawer size="60%" title="客户详情" :visible.sync="isShowDetailDrawer" direction="rtl">
      <div class="drawer-container">
        <div class="info-item">
          <div class="label">ID</div>
          <div class="content">{{ currentClient.id || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">客户</div>
          <div class="content">{{ currentClient.client || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">类型</div>
          <div class="content">{{ currentClient.type || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">行业</div>
          <div class="content">{{ currentClient.industry || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">区域</div>
          <div class="content">{{ currentClient.area || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">业务场景</div>
          <div class="content">{{ currentClient.scene || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">优先级</div>
          <div class="content">{{ currentClient.priority || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">算力空间</div>
          <div class="content">{{ currentClient.space || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">需求</div>
          <div class="content">{{ currentClient.demand || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">拓展堵点</div>
          <div class="content">{{ currentClient.block || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">解决路径</div>
          <div class="content">{{ currentClient.solution || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">合作状态</div>
          <div class="content">{{ currentClient.status || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">落地时间</div>
          <div class="content">{{ currentClient.landingTime || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">责任BD</div>
          <div class="content">{{ currentClient.ownbd || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">签约类型</div>
          <div class="content">{{ currentClient.contractType || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">签约算力</div>
          <div class="content">{{ currentClient.contractCompute || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">签约周期</div>
          <div class="content">{{ currentClient.contractCycle || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">签约规模</div>
          <div class="content">{{ currentClient.contractScale || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">签约时间</div>
          <div class="content">{{ currentClient.contractTime || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">当前状态</div>
          <div class="content">{{ currentClient.currentStatus || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">上线时间</div>
          <div class="content">{{ currentClient.onlineTime || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">下线时间</div>
          <div class="content">{{ currentClient.offlineTime || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">签约金额</div>
          <div class="content">{{ currentClient.contractAmount || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">回款状态</div>
          <div class="content">{{ currentClient.remittanceAmount || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">适配状态</div>
          <div class="content">{{ currentClient.adaptationStatus || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">适配类型</div>
          <div class="content">{{ currentClient.adaptationType || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">大模型</div>
          <div class="content">{{ currentClient.bigModel || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">大模型名称</div>
          <div class="content">{{ currentClient.modelName || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">适配进展</div>
          <div class="content">{{ currentClient.adaptationProgress || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">问题堵点</div>
          <div class="content">{{ currentClient.problemBlock || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">解决办法</div>
          <div class="content">{{ currentClient.adaptationSolution || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">责任FAE</div>
          <div class="content">{{ currentClient.ownfae || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">200DK机会点（台）</div>
          <div class="content">{{ currentClient.chancePoint || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">200DK已销售（台）</div>
          <div class="content">{{ currentClient.dksold || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">200DK销售金额（元）</div>
          <div class="content">{{ currentClient.dkamount || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">其他硬件带货硬件类型</div>
          <div class="content">{{ currentClient.hardType || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">其他硬件带货机会点（台）</div>
          <div class="content">{{ currentClient.hardChance || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">其他硬件带货已销售（台）</div>
          <div class="content">{{ currentClient.hardSold || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">其他硬件带货销售金额（台）</div>
          <div class="content">{{ currentClient.hardAmount || '--' }}</div>
        </div>
        <div class="info-item">
          <div class="label">是否发布</div>
          <div class="content">
            <el-switch
              v-model="isPublish2"
              active-color="#13ce66"
              inactive-color="#ff4949"
              active-text="是"
              inactive-text="否"
              @change="changePublish">
            </el-switch>
        </div>
        </div>
      </div>

      <el-row :gutter="40">
        <el-col :span="24">
          <div class="edit-wrap">
            <div class="info-item">
              <div class="label">
                <span class="label-text">算力签约合同</span>
                <el-button type="primary" @click="handleAddContract">新增</el-button>
              </div>

              <div v-for="contract in contracts" style="margin-top: 10px">
                <span class="content" >{{ contract.contractTime || '--' }}</span>
<!--                <span style="margin-left: 20px">合同相关文件</span>-->
<!--                <el-button style="margin-left: 5px" @click="download(contract.agreement)">点击下载</el-button>-->
                <div class="content" style="width: 100%">签约金额：{{ contract.contractAmount || '--' }}</div>
                <div class="content" style="width: 100%">回款金额：{{ contract.refund || '--' }}</div>
              </div>
            </div>
          </div>
        </el-col>

      </el-row>
      <el-row :gutter="40">
        <el-col :span="24">
          <div class="edit-wrap">
            <div class="info-item">
              <div class="label">
                <span class="label-text">200dk销售</span>
                <el-button type="primary" @click="handleAdd200dk">新增</el-button>
              </div>

              <div v-for="contract in x200dks" style="margin-top: 10px">
                <span class="content" >{{ contract.contractTime || '--' }}</span>
<!--                <span style="margin-left: 20px">合同相关文件</span>-->
<!--                <el-button style="margin-left: 5px" @click="download(contract.agreement)">点击下载</el-button>-->
                <div class="content" style="width: 100%">200dk金额：{{ contract['x200dkAmount'] || '--' }}</div>
                <div class="content" style="width: 100%">200dk个数：{{ contract['x200dkCount'] || '--' }}</div>
              </div>
            </div>
          </div>
        </el-col>

      </el-row>

      <el-row :gutter="40">
        <el-col :span="24">
          <div class="edit-wrap">
            <div class="info-item">
              <div class="label">
                <span class="label-text">硬件带货</span>
                <el-button type="primary" @click="handleAddHardware">新增</el-button>
              </div>

              <div v-for="contract in hardwares" style="margin-top: 10px">
                <span class="content" >{{ contract.contractTime || '--' }}</span>
<!--                <span style="margin-left: 20px">合同相关文件</span>-->
<!--                <el-button style="margin-left: 5px" @click="download(contract.agreement)">点击下载</el-button>-->
                <div class="content" style="width: 100%">硬件类型：{{ contract.hardType=='1'?'鲲鹏':'昇腾' || '--' }}</div>
                <div class="content" style="width: 100%">硬件金额：{{ contract.hardAmount || '--' }}</div>
              </div>
            </div>
          </div>
        </el-col>

      </el-row>

      <el-row :gutter="40">
        <el-col :span="12">
          <div class="edit-wrap">
            <div class="info-item">
              <div class="label">
                <span class="label-text">最近拜访时间 以及 拓展进展</span>
                <el-button type="primary" @click="handleAddVisit">新增</el-button>
              </div>

              <div v-for="visit in visits" style="margin-top: 10px">
                <div class="content">{{ visit.visitTime || '--' }}</div>
                <div class="content1" >{{ visit.visitText || '--' }}</div>
                <div class="content2">{{ visit.progress || '--' }}</div>
              </div>
            </div>
          </div>
        </el-col>

        <el-col :span="12">
          <div class="edit-wrap">
            <div class="info-item">
              <div class="label">
                <span class="label-text">大模型-最近拜访时间 以及 拓展进展</span>
                <el-button type="primary" @click="handleAddModel">新增</el-button>
              </div>

              <div v-for="model in models" style="margin-top: 10px">
                <span class="content">{{ model.contractTime || '--' }}</span>
<!--                <span style="margin-left: 20px">合同相关文件</span>-->
<!--                <el-button style="margin-left: 5px" @click="download(model.agreementFile)">点击下载</el-button>-->
                <div class="content">{{ model.modelProgress || '--' }}</div>
              </div>
            </div>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="40">
        <el-col :span="24">
          <div class="edit-wrap">
            <div class="info-item">
              <div class="label">
                <span class="label-text">签约信息</span>
                <el-button type="primary" @click="handleAddAgency">新增</el-button>
              </div>
              <el-table
                :data="agencyTableData"
                stripe
                style="width: 100%">
                <el-table-column
                  prop="applTime"
                  label="审批日期"
                  width="110">
                </el-table-column>
                <el-table-column
                  prop="status"
                  label="审批结果"
                  width="100">
                  <template v-slot="scope">
                    <span>{{ scope.row.status=="2"?"通过": scope.row.status=="3"?"驳回":"待审核" }}</span>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="applBy"
                  label="审批人"
                  width="100">
                </el-table-column>
                <el-table-column
                  prop="remark"
                  label="审批原因"
                  >
                </el-table-column>
                <el-table-column
                  prop="applDesc"
                  label="申请说明"
                 >
                </el-table-column>
                <el-table-column label="操作"  width="200" align="center">
                  <template slot-scope="scope">
                    <el-button type="primary" @click="download(scope.row.fileUrl)">下载文件</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
        </el-col>
        
      </el-row>




    </el-drawer>

    <el-dialog width="500px" title="新增签约合同记录" :visible.sync="isShowAddContractDialog">
          <el-form :model="contractEntity">

            <el-form-item prop="onlineTime" label="算力合同签约时间">
              <span style="color: #F56C6C">* </span>
              <el-date-picker v-model="contractEntity.contractTime" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
            </el-form-item>

<!--            <el-form-item prop="agreement" label="签约合同">-->
<!--              <span style="color: #F56C6C">* </span>-->
<!--              <el-upload action="http://localhost:9090/file/upload" ref="file" :on-success="contracthandleFileUploadSuccess">-->
<!--                <el-button size="small" type="primary">点击上传</el-button>-->
<!--              </el-upload>-->

<!--            </el-form-item>-->
            <el-form-item label="签约金额">
              <span style="color: #F56C6C">* </span>
              <el-input type="textarea" v-model="contractEntity.contractAmount" autocomplete="off"></el-input>
            </el-form-item>

            <el-form-item label="回款金额">
<!--              <span style="color: #F56C6C">* </span>-->
              <el-input type="textarea" v-model="contractEntity.refund" autocomplete="off"></el-input>
            </el-form-item>

          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="isShowAddContractDialog = false">取 消</el-button>
            <el-button type="primary" @click="addContract">确 定</el-button>
          </div>
        </el-dialog>

        <el-dialog width="500px" title="新增200dk" :visible.sync="isShowAdd200dkDialog">
          <el-form :model="add200dkEntity">

            <el-form-item prop="onlineTime" label="200dk时间">
              <span style="color: #F56C6C">* </span>
              <el-date-picker v-model="add200dkEntity.contractTime" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
            </el-form-item>

<!--            <el-form-item prop="agreement" label="签约合同">-->
<!--              <span style="color: #F56C6C">* </span>-->
<!--              <el-upload action="http://localhost:9090/file/upload" ref="file" :on-success="contracthandleFileUploadSuccess">-->
<!--                <el-button size="small" type="primary">点击上传</el-button>-->
<!--              </el-upload>-->

<!--            </el-form-item>-->
            <el-form-item label="200dk金额">
              <span style="color: #F56C6C">* </span>
              <el-input type="textarea" v-model="add200dkEntity['x200dkAmount']" autocomplete="off"></el-input>
            </el-form-item>

            <el-form-item label="200dk个数">
<!--              <span style="color: #F56C6C">* </span>-->
              <el-input type="textarea" v-model="add200dkEntity['x200dkCount']" autocomplete="off"></el-input>
            </el-form-item>

          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="isShowAdd200dkDialog = false">取 消</el-button>
            <el-button type="primary" @click="addX200dk">确 定</el-button>
          </div>
        </el-dialog>
        <el-dialog width="500px" title="新增硬件带货记录" :visible.sync="isShowAddhardwareDialog">
          <el-form :model="hardwareEntity">

            <el-form-item prop="onlineTime" label="硬件带货时间">
              <span style="color: #F56C6C">* </span>
              <el-date-picker v-model="hardwareEntity.contractTime" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
            </el-form-item>

<!--            <el-form-item prop="agreement" label="签约合同">-->
<!--              <span style="color: #F56C6C">* </span>-->
<!--              <el-upload action="http://localhost:9090/file/upload" ref="file" :on-success="contracthandleFileUploadSuccess">-->
<!--                <el-button size="small" type="primary">点击上传</el-button>-->
<!--              </el-upload>-->

<!--            </el-form-item>-->

            <el-form-item label="硬件金额">
                         <span style="color: #F56C6C">* </span>
              <el-input type="textarea" v-model="hardwareEntity.hardAmount" autocomplete="off"></el-input>
            </el-form-item>


            <el-form-item label="硬件类型">
              <span style="color: #F56C6C">* </span>
              <el-select v-model="hardwareEntity.hardType" placeholder="请选择硬件类型">
                <el-option label="鲲鹏" value="1"></el-option>
                <el-option label="昇腾" value="2"></el-option>
              </el-select>
            </el-form-item>

          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="isShowAddhardwareDialog = false">取 消</el-button>
            <el-button type="primary" @click="addHardware">确 定</el-button>
          </div>
        </el-dialog>

        
    <el-dialog width="500px" title="新增拜访情况记录" :visible.sync="isShowAddTimeDialog">
      <el-form :model="entity">

        <el-form-item prop="onlineTime" label="拜访时间">
          <span style="color: #F56C6C">* </span>
          <el-date-picker v-model="entity.visitTime" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
        </el-form-item>

        <el-form-item label="新增拜访情况记录">
          <el-input type="textarea" v-model="entity.visitText" autocomplete="off"></el-input>
        </el-form-item>

        <el-form-item label="新增拓展进展">
          <el-input type="textarea" v-model="entity.progress" autocomplete="off"></el-input>
        </el-form-item>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="isShowAddTimeDialog = false">取 消</el-button>
        <el-button type="primary" @click="addVisit">确 定</el-button>
      </div>
    </el-dialog>
    


    <el-dialog width="500px" title="新增大模型拜访情况记录" :visible.sync="isShowAddModelDialog">
      <el-form :model="modelEntity">

        <el-form-item prop="onlineTime" label="拜访时间">
          <span style="color: #F56C6C">* </span>
          <el-date-picker v-model="modelEntity.contractTime" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
        </el-form-item>

<!--        <el-form-item prop="agreementFile" label="大模型合同">-->

<!--          <el-upload action="http://localhost:9090/file/upload" ref="file" :on-success="handleFileUploadSuccess">-->
<!--            <el-button size="small" type="primary">点击上传</el-button>-->
<!--          </el-upload>-->

<!--        </el-form-item>-->

        <el-form-item label="新增拜访情况记录">
          <el-input type="textarea" v-model="modelEntity.modelProgress" autocomplete="off"></el-input>
        </el-form-item>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="isShowAddModelDialog = false">取 消</el-button>
        <el-button type="primary" @click="addModel">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog width="500px" title="新增签约信息审批" :visible.sync="isShowAddAgencyDialog">
      <el-form :model="agencyEntity">

        <el-form-item prop="onlineTime" label="申请说明">
          <el-input type="textarea" v-model="agencyEntity.applDesc" autocomplete="off"></el-input>
        </el-form-item>

<!--        <el-form-item label="合同文件">-->
<!--          <el-upload :action="$baseUrl + '/file/upload'" :show-file-list="true"-->
<!--                    :on-success="handleFileUploadSuccess2" limit="1" :file-list="fileList" :on-exceed="handleExceed" style="display: inline-block">-->
<!--            &lt;!&ndash; <el-button type="primary" v-show="agencyEntity.fileUrl" plain class="ml-5">重新文件 <i class="el-icon-top"></i></el-button> &ndash;&gt;-->
<!--            <el-button type="primary" plain class="ml-5">上传文件 <i class="el-icon-top"></i></el-button>-->
<!--          </el-upload>-->
<!--        </el-form-item>-->
        
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="isShowAddAgencyDialog = false">取 消</el-button>
        <el-button type="primary" @click="addAgency">确 定</el-button>
      </div>
    </el-dialog>


  </div>
</template>

<script>
export default {
  name: 'XCompany',
  props: {
    themeStatus: Number
  },
  data() {
    return {
      themes: ['theme1', 'theme2', 'theme3', 'theme4', 'theme5', 'theme6', 'theme7', 'theme8'],
      tableData: [],
      total: 0,
      pageNum: 1,
      pageSize: 100,
      form: {},
      entity:{},
      modelEntity:{},
      contractEntity:{},
      hardwareEntity:{},
      add200dkEntity:{},
      agencyEntity:{},
      visits:[],
      models:[],
      contracts:[],
      x200dks:[],
      hardwares:[],
      dialogFormVisible: false,
      dialogFormVisible1: false,
      multipleSelection: [],
      agencyTableData: [],
      user: localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {},
      rules: {
        client: [
            { required: true, message: '请输入名称', trigger: 'blur' }
        ],
        ownbd: [
          { required: true, message: '请输入责任BD', trigger: 'blur' }
        ]
      },
      optionsPriority: [{
        value: '高',
        label: '高'
      }, {
        value: '中',
        label: '中'
      }, {
        value: '低',
        label: '低'
      }],
      valuePriority: '',
      optionsType: [{
        value: '企业',
        label: '企业'
      }, {
        value: '高校',
        label: '高校'
      }, {
        value: '科研机构',
        label: '科研机构'
      }],
      valueType: '',
      optionsBigModel: [{
        value: '是',
        label: '是'
      }, {
        value: '否',
        label: '否'
      }],
      valueBigModel: '',
      optionsIndustry: [{
        value: '制造',
        label: '制造'
      }, {
        value: '数字政府',
        label: '数字政府'
      }, {
        value: '金融',
        label: '金融'
      }, {
        value: '安平',
        label: '安平'
      }, {
        value: '交通',
        label: '交通'
      }, {
        value: '互联网',
        label: '互联网'
      }, {
        value: '医疗',
        label: '医疗'
      }, {
        value: '教育',
        label: '教育'
      }, {
        value: '电力能源',
        label: '电力能源'
      }, {
        value: '大企业',
        label: '大企业'
      }, {
        value: '农业',
        label: '农业'
      }],
      valueIndustry: '',
      optionsArea: [{
        value: '南京市',
        label: '南京市'
      }, {
        value: '江北新区',
        label: '江北新区'
      }, {
        value: '无锡市',
        label: '无锡市'
      },{
        value: '徐州市',
        label: '徐州市'
      }, {
        value: '常州市',
        label: '常州市'
      }, {
        value: '苏州市',
        label: '苏州市'
      }, {
        value: '南通市',
        label: '南通市'
      }, {
        value: '连云港市',
        label: '连云港市'
      }, {
        value: '淮安市',
        label: '淮安市'
      }, {
        value: '盐城市',
        label: '盐城市'
      }, {
        value: '扬州市',
        label: '扬州市'
      }, {
        value: '镇江市',
        label: '镇江市'
      }, {
        value: '泰州市',
        label: '泰州市'
      }, {
        value: '宿迁市',
        label: '宿迁市'
      }],
      valueArea: '',
      optionsownbd: [{
        value: '谢天',
        label: '谢天'
      }, {
        value: '鲁曦',
        label: '鲁曦'
      }, {
        value: '孙东明',
        label: '孙东明'
      }, {
        value: '李光峥',
        label: '李光峥'
      }, {
        value: '吴心一',
        label: '吴心一'
      }, {
        value: '唐旭',
        label: '唐旭'
      }, {
        value: '孙乾凯',
        label: '孙乾凯'
      }, {
        value: '董杰',
        label: '董杰'
      }, {
        value: '曹中旭',
        label: '曹中旭'
      }],
      valueownbd: '',
      optionsStatus: [{
        value: '没有联系方式',
        label: '没有联系方式'
      }, {
        value: '拓展中',
        label: '拓展中'
      }, {
        value: '技术适配中',
        label: '技术适配中'
      }, {
        value: '适配完成',
        label: '适配完成'
      }, {
        value: '商务谈判中',
        label: '商务谈判中'
      }, {
        value: '完成采购协议',
        label: '完成采购协议'
      }, {
        value: '业务上线',
        label: '业务上线'
      }, {
        value: '合作停滞',
        label: '合作停滞'
      }, {
        value: '业务下线',
        label: '业务下线'
      }, {
        value: '大模型合作',
        label: '大模型合作'
      }],
      valueStatus: '',
      optionsBlock: [{
        value: '客户数据安全原因',
        label: '客户数据安全原因'
      }, {
        value: '框架生态支持度低',
        label: '框架生态支持度低'
      }, {
        value: '910A芯片能力问题',
        label: '910A芯片能力问题'
      }, {
        value: '算法算子不支持问题',
        label: '算法算子不支持问题'
      }, {
        value: '没有联系方式',
        label: '没有联系方式'
      }, {
        value: '价格高，导致客户意愿度不高',
        label: '价格高，导致客户意愿度不高'
      }, {
        value: '适配工作量大或人力不足，导致客户意愿度不高',
        label: '适配工作量大或人力不足，导致客户意愿度不高'
      }, {
        value: '没有国产化诉求，导致客户意愿度不高',
        label: '没有国产化诉求，导致客户意愿度不高'
      }],
      valueBlock: '',
      optionsContractType: [{
        value: '专属资源池',
        label: '专属资源池'
      }, {
        value: '共享资源池',
        label: '共享资源池'
      }],
      valueContractType: '',

      optionsownfae: [{
        value: '崔宝宝',
        label: '崔宝宝',
      },{
        value: '赵慧慧',
        label: '赵慧慧',
      },{
        value: '张亮',
        label: '张亮',
      },{
        value: '韩升原',
        label: '韩升原',
      }],
      valueownfae: '',
      optionsCurrentStatus: [{
        value: '已上线',
        label: '已上线',
      },{
        value: '蓄水',
        label: '蓄水',
      },{
        value: '已结束',
        label: '已结束',
      }],
      valueCurrentStatus: '',
      isShowDetailDrawer: false,
      currentClient: {},
      isShowAddTimeDialog: false,
      isShowAddModelDialog: false,
      isShowAddContractDialog: false,
      isShowAdd200dkDialog: false,
      isShowAddhardwareDialog: false,
      isShowAddAgencyDialog: false,
      bigModel:'',
      client: '',
      priority:'',
      type:'',
      industry:'',
      area:'',
      ownbd:'',
      status:'',
      block:'',
      contractType:'',
      ownfae:'',
      currentStatus:'',
      hardType:'',
      startDate:'',
      endDate:'',
      modelName: '',
      isPublish2:'',
      fileList:[]
    }
  },
  created() {
    this.load()
  },
  methods: {
    load() {
      this.request
        .get('/xCompany/page', {
          params: {
            pageNum: this.pageNum,
            pageSize: this.pageSize,
            client: this.client,
            priority:this.priority,
            type:this.type,
            industry:this.industry,
            area:this.area,
            ownbd:this.ownbd,
            status:this.status,
            block:this.block,
            contractType:this.contractType,
            ownfae:this.ownfae,
            currentStatus:this.currentStatus,
            hardType:this.hardType,
            startDate:this.startDate,
            endDate:this.endDate,
            bigModel:this.bigModel,
            modelName:this.modelName,
            roleAdmin:this.user.role,
            userName:this.user.username,
            // user:this.user,
            // userName:this.$store.getters.userInfo.username,
          }
        })
        .then((res) => {
          this.tableData = res.data.records
          this.total = res.data.total
        })
    },
    handleAddVisit(){
      this.isShowAddTimeDialog=true
      this.entity={}
    },
    handleAddModel(){
      this.isShowAddModelDialog=true
      this.modelEntity={}
    },
    handleAddAgency(){
      this.isShowAddAgencyDialog=true
      this.agencyEntity={}
      this.fileList = []
    },
    handleAddContract(){
      this.isShowAddContractDialog=true
      this.contractEntity={}
    },
    handleAdd200dk(){
      this.isShowAdd200dkDialog=true
      this.add200dkEntity={}
    },
    handleAddHardware(){
      this.isShowAddhardwareDialog=true
      this.hardwareEntity={}
    },
    loadVisit(){
      this.request.get("/xVisit/findAllByClientId/"+this.currentClient.id).then(res=>{
        this.visits=res.data
      })
    },
    loadModels(){
      this.request.get("/xModel/findAllByClientId/"+this.currentClient.id).then(res=>{
        this.models=res.data
      })
    },
    loadAgency(){
      this.request.get("/xAgencyAppl/findAllByClientId/"+this.currentClient.id).then(res=>{
        this.agencyTableData=res.data
      })
    },
    loadContract(){
      this.request.get("/xContract/findAllByClientId/"+this.currentClient.id).then(res=>{
        this.contracts=res.data
      })
    },
    loadHardware(){
      this.request.get("/xHardware/findAllByClientId/"+this.currentClient.id).then(res=>{
        this.hardwares=res.data
      })
    },
    load200dk(){
      this.request.get("/x200dk/findAllByClientId/"+this.currentClient.id).then(res=>{
        this.x200dks=res.data
      })
    },
    addVisit(){
      if(!this.entity.visitTime){
        this.$message.warning("请填写拜访时间")
        return
      }
      this.entity.clientId=this.currentClient.id
      this.request.post("/xVisit",this.entity).then(res=>{
        this.$message.success("添加记录成功")
        this.isShowAddTimeDialog=false
        this.loadVisit()
      })
    },
    addModel(){
      if(!this.modelEntity.contractTime){
        this.$message.warning("请填写拜访时间")
        return
      }
      this.modelEntity.clientId=this.currentClient.id
      this.request.post("/xModel",this.modelEntity).then(res=>{
        this.$message.success("添加模型成功")
        this.isShowAddModelDialog=false
        this.loadModels()
      })
    },
    addAgency(){
      // if(!this.agencyEntity.fileUrl){
      //   this.$message.warning("请上传文件")
      //   return
      // }
      if(!this.agencyEntity.applDesc){
        this.$message.warning("请填写申请说明")
        return
      }
      this.agencyEntity.clientId=this.currentClient.id
      this.agencyEntity.createBy = this.user.nickname
      this.request.post("/xAgencyAppl",this.agencyEntity).then(res=>{
        this.$message.success("添加申请成功")
        this.isShowAddAgencyDialog=false
        this.loadAgency()
      })
    },
    addHardware(){
      this.hardwareEntity.clientId=this.currentClient.id
      if(!this.hardwareEntity.contractTime){
        this.$message.warning("请填写硬件带货时间")
        return
      }
      if(!this.hardwareEntity.hardAmount){
        this.$message.warning("请填写硬件金额")
        return
      }
      // if(!this.contractEntity.agreement){
      //   this.$message.warning("请上传合同")
      //   return
      // }
      this.request.post("/xHardware",this.hardwareEntity).then(res=>{
        this.$message.success("添加硬件带货成功")
        this.isShowAddhardwareDialog=false
        this.loadHardware()
      })
    },
    addContract(){
      this.contractEntity.clientId=this.currentClient.id
      if(!this.contractEntity.contractTime){
        this.$message.warning("请填写算力合同签约时间")
        return
      }
      if(!this.contractEntity.contractAmount){
        this.$message.warning("请填写签约金额")
        return
      }
      // if(!this.contractEntity.agreement){
      //   this.$message.warning("请上传合同")
      //   return
      // }
      this.request.post("/xContract",this.contractEntity).then(res=>{
        this.$message.success("添加合同成功")
        this.isShowAddContractDialog=false
        this.loadContract()
      })
    },
    addX200dk(){
      this.add200dkEntity.clientId=this.currentClient.id
      if(!this.add200dkEntity.contractTime){
        this.$message.warning("请填写200dk时间")
        return
      }
      if(!this.add200dkEntity['x200dkAmount']){
        this.$message.warning("请填写200dk金额")
        return
      }
      // if(!this.contractEntity.agreement){
      //   this.$message.warning("请上传合同")
      //   return
      // }
      this.request.post("/x200dk",this.add200dkEntity).then(res=>{
        this.$message.success("添加合同成功")
        this.isShowAdd200dkDialog=false
        this.load200dk()
      })
    },
    
    save() {
      this.$refs['ruleForm'].validate((valid) => {
        if (valid) {
          this.request.post('/xCompany/insertXCompany', this.form).then((res) => {
            if (res.code === '200') {
              this.$message.success('保存成功')
              this.dialogFormVisible = false
              this.load()
            } else {
              this.$message.error(res.msg)
            }
          })
        }
      })
    },
    save1() {
      this.$refs['ruleForm'].validate((valid) => {
        if (valid) {
          this.request.post('/xCompany', this.form).then((res) => {
            if (res.code === '200') {
              this.$message.success('保存成功')
              this.dialogFormVisible1 = false
              this.load()
            } else {
              this.$message.error(res.msg)
            }
          })
        }
      })
    },
    handleAdd() {
      this.dialogFormVisible = true
      this.form = {}
      this.$nextTick(() => {
        if (this.$refs.img) {
          this.$refs.img.clearFiles()
        }
        if (this.$refs.file) {
          this.$refs.file.clearFiles()
        }
      })
    },
    handleEdit(row) {
      this.form = JSON.parse(JSON.stringify(row))
      this.dialogFormVisible1 = true
      this.$nextTick(() => {
        if (this.$refs.img) {
          this.$refs.img.clearFiles()
        }
        if (this.$refs.file) {
          this.$refs.file.clearFiles()
        }
      })
    },
    del(id) {
      this.request.delete('/xCompany/' + id).then((res) => {
        if (res.code === '200') {
          this.$message.success('删除成功')
          this.load()
        } else {
          this.$message.error('删除失败')
        }
      })
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    },
    delBatch() {
      if (!this.multipleSelection.length) {
        this.$message.error('请选择需要删除的数据')
        return
      }
      let ids = this.multipleSelection.map((v) => v.id) // [{}, {}, {}] => [1,2,3]
      this.request.post('/xCompany/del/batch', ids).then((res) => {
        if (res.code === '200') {
          this.$message.success('批量删除成功')
          this.load()
        } else {
          this.$message.error('批量删除失败')
        }
      })
    },
    reset() {
      this.client = ''
      this.priority = ''
      this.type = ''
      this.industry = ''
      this.area = ''
      this.ownbd = ''
      this.status = ''
      this.block = ''
      this.contractType = ''
      this.ownfae = ''
      this.currentStatus = ''
      this.hardType = ''
      this.startDate = ''
      this.endDate = ''
      this.bigModel = ''
      this.load()
    },
    handleSizeChange(pageSize) {
      this.pageSize = pageSize
      this.load()
    },
    handleCurrentChange(pageNum) {
      this.pageNum = pageNum
      this.load()
    },
    handleFileUploadSuccess(res) {
      this.modelEntity.agreementFile = res
    },
    contracthandleFileUploadSuccess(res) {
      this.contractEntity.agreement = res
    },
    download(url) {
      if (url==null || url==''){
        this.$message.error("文件地址不存在")
        return
      }
      window.open(url)
    },
    exp() {
      window.open(this.$baseUrl + '/xCompany/export')
    },
    handleExcelImportSuccess() {
      this.$message.success('导入成功')
      this.load()
    },
    handleShowDetail(id) {
      this.currentClient = this.tableData?.find((item) => item.id === id)
      this.isPublish2 = this.currentClient.isPublish?true:false
      this.isShowDetailDrawer = true
      this.loadVisit()
      this.loadModels()
      this.loadContract()
      this.loadHardware()
      this.load200dk()
      this.loadAgency()
    },
    //是否发布状态改变
    changePublish(){
      this.currentClient.isPublish = this.isPublish2?1:2
      this.request.post('/xCompany/updPublish', {id:this.currentClient.id,isPublish:this.currentClient.isPublish}).then((res) => {
        if (res.code === '200') {
        } else {
          this.$message.error('状态变更失败')
        }
      })
    },
    handleFileUploadSuccess2(res) {
      this.$message.success("上传成功")
      this.agencyEntity.fileUrl = res
    },
    handleExceed(){
      this.$message.warning('鼠标放到√处删除再重新上传');
    }
  }
}
</script>

<style scoped>
.el-button--primary {
  color: var(--font-color-primary);
  background-color: var(--back-color-primary);
  border-color: var(--back-color-primary);
}

.el-button--primary:focus,
.el-button--primary:hover {
  background: var(--font-color-primary);
  border-color: var(--font-color-primary);
  border-color: var(--back-color-primary);
  color: #fff;
}

.el-button--danger {
  color: rgb(214, 48, 49);
  background-color: rgb(214, 48, 49, 0.1);
  border-color: rgb(214, 48, 49, 0.1);
}

.el-button--danger:focus,
.el-button--danger:hover {
  background: rgb(214, 48, 49);
  border-color: rgb(214, 48, 49);
  border-color: rgb(214, 48, 49, 0.1);
  color: #fff;
}

.table-row-options-warp span {
  cursor: pointer;
  color: var(--font-color-primary);
}
.table-row-options-warp span:last-child {
  cursor: pointer;
  color: #d63031;
}

.row-client {
  color: var(--color-primary);
  cursor: pointer;
}
.drawer-container {
  margin: 0 20px 20px 20px;
  font-size: 14px;
  line-height: 1.65;
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #eee;
}
.info-item {
  width: 50%;
  display: flex;
  margin-bottom: 10px;
}
.info-item .label {
  margin-right: 10px;
  min-width: 70px;
  text-align: justify;
}
.info-item .content {
  color: #333;
}
.edit-wrap {
  padding: 0 20px;
}
.edit-wrap .info-item {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 20px;
}
.edit-wrap .info-item .label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 10px;
}
.label-text {
  border-left: 3px solid var(--color-primary);
  padding-left: 5px;
  font-size: 15px;
}
.edit-wrap .info-item .content {
  width: 25%;
  margin-left: 8px;
  background-color: #eee;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
}
.edit-wrap .info-item .content1 {
  width: 48%;
  margin-left: 8px;
  margin-top: 0px;
  background-color: #eee;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  display: inline-block;
}
.edit-wrap .info-item .content2 {
  width: 48%;
  /*margin-left: 8px;*/
  background-color: #eee;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  display: inline-block;
}
</style>
